﻿@using BugChang.DES.Web.Mvc.Models.Common
<div class="row">
    <div class="col-xs-3">
        <div class="box box-primary">
            <div class="box-header with-border">
                <h3 class="box-title">机构树</h3>
            </div>
            <div class="box-body">
                <div style="max-height: 600px; overflow-y: scroll;overflow-x:hidden ">
                    <ul id="departmentTree" class="ztree"></ul>
                </div>

            </div>
        </div>
    </div>
    <div class="col-xs-9">
        <div class="row">
            <div class="col-xs-12">
                <div class="box box-primary">
                    <div class="box-header with-border">
                        <div class="btn-group">
                            <button id="btnAddDepartment" type="button" class="btn btn-primary" data-toggle="modal" data-target="#DepartmentCreateModal" data-backdrop="static" data-keyboard="false"><i class="fa  fa-plus-circle"></i> 新增</button>
                            <button id="btnRefresh" type="button" class="btn btn-primary"><i class="fa  fa-refresh"></i> 刷新</button>
                        </div>
                    </div>
                    <div class="box-body">
                        <div class="table-responsive">
                            <table id="table" class="table table-bordered table-hover text-nowrap"></table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="modal fade" id="DepartmentCreateModal" role="dialog">
    <div class="modal-dialog">
        <div class="modal-content">
            <form id="DepartmentCreateForm" method="post" asp-controller="Department" asp-action="Create">
                @Html.Partial("~/Views/Shared/Modals/_ModalHeader.cshtml", new ModalHeaderViewModel("新增机构"))
                <div class="modal-body">
                    <div class="form-group">
                        <label>上级机构</label>
                        <select class="form-control parent-select" name="ParentId" style="width: 100%"></select>
                    </div>
                    <div class="form-group">
                        <label>名称</label>
                        <input type="text" class="form-control" name="Name">
                    </div>
                    <div class="form-group">
                        <label>全称</label>
                        <input type="text" class="form-control" name="FullName" placeholder="无特殊情况无需填写">
                    </div>
                    <div class="form-group">
                        <label>地址</label>
                        <input type="text" class="form-control" name="Address" placeholder="例：北京市">
                    </div>
                    <div class="form-group">
                        <label>机构代码</label>
                        <input type="text" class="form-control" name="Code">
                    </div>
                    <div class="form-group">
                        <label>默认收件渠道</label>
                        <select class="form-control channel-select" name="ReceiveChannel" style="width: 100%"></select>
                    </div>
                    <div class="form-group">
                        <label>排序</label>
                        <input type="number" class="form-control" name="Sort" />
                    </div>

                </div>
                @Html.Partial("~/Views/Shared/Modals/_ModalFooterWithSaveAndCancel.cshtml")
            </form>
        </div>
    </div>
</div>
<div class="modal fade" id="DepartmentEditModal" role="dialog">
    <div class="modal-dialog">
        <div class="modal-content">

        </div>
    </div>
</div>
@section scripts
    {
    <script src="~/views-resource/department/index.js" asp-append-version="true"></script>
}